<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>matchAll</title>
  </head>
  <body>
    <script>
      let str = `<ul>
      <li>
        <a>肖生客的救赎</a>
        <p>上映日期：1994-09-10</p>
      </li>
      <li>
        <a>阿甘正传</a>
        <p>上映日期：1994-06-20</p>
      </li>
    </ul>`;

      // 声明正则
      const reg = /<li>.*?<a>(.*?)<\/a>.*?<p>(.*?)<\/p>/gs;
      const result = str.matchAll(reg);

      console.log(result);

      console.log([...result]);
    </script>
  </body>
</html>
